<template>
<div class="square">
  <div class="page-navbar">
    <div class="nav-bar">
      <div class="touxiang">
        <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
      </div>
      <div class="top-icon"><i class="el-icon-document-copy"></i></div>
      <!-- navbar -->
      <mt-navbar class="page-part" v-model="selected">
        <mt-tab-item id="关注">
          关注
          <div class="line"></div>
        </mt-tab-item>
        <mt-tab-item id="推荐">
          推荐
          <div class="line"></div>
        </mt-tab-item>
      </mt-navbar>
    </div>
    <!-- tabcontainer -->
    <mt-tab-container v-model="selected">
      <mt-tab-container-item id="推荐" style="margin-top: 60px">
        <el-card class="box-card">
          <div v-for="o in 5" :key="o" class="text item">
            <div class="box2">
              <div class="header">
                <div class="picture">
                  <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
                </div>
                <span class="xinxi">
                  <div class="name">张三</div>
                  <div class="time">10点</div>
                </span>
                <div class="more">
                  <el-dropdown trigger="click">
                    <span class="el-dropdown-link">
                      <i class="el-icon-arrow-down el-icon--right"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown" style="margin-right:-30px">
                      <el-dropdown-item command="a">关注用户</el-dropdown-item>
                      <el-dropdown-item command="b">不感兴趣</el-dropdown-item>
                      <el-dropdown-item command="c">举报帖子</el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
                </div>
              </div>
              <el-divider style="margin-top:-50px"></el-divider>
              <div class="neirong">
                撒刁圣诞节艾斯欧就打死哦加斯哦电视
              </div>
              <div class="img">
                <el-image src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg"></el-image>
                <div class="footer">
                  <el-button type="info" plain class="footer-bottom"> <span style="padding-right:.1rem; font-size:18px" class="iconfont icon-xiaoxi"> </span></el-button>
                  <el-button type="info" plain class="footer-bottom" style="margin-left:30px"><i style="padding-right:.1rem;font-size:20px" class="iconfont icon-good"></i></el-button>
                </div>
              </div>
            </div>
          </div>
        </el-card>
      </mt-tab-container-item>
      <mt-tab-container-item id="关注" style="margin-top: 60px">
        <div class="follow-card">
          <div v-for="o in 5" :key="o" class="follow-item">
            <van-swipe-cell :before-close="beforeClose">
              <van-cell :border="false" style="border-radius: 8px;">
                <div class="item-content">
                  <div>
                    <img class="item-img" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
                  </div>
                  <div class="item-info">张三</div>
                  <div class="icon-image">10点</div>
                </div>
              </van-cell>
              <template #right right-width="80px">
                <div class="delect">
                  <div class="delect-text">取消关注</div>
                </div>
              </template>
            </van-swipe-cell>
          </div>
        </div>
      </mt-tab-container-item>
    </mt-tab-container>
  </div>
  <el-button icon="el-icon-plus" circle class="button" ></el-button>
</div>
</template>

<script>
import {
  Dialog
} from 'vant';
export default {
  name: "square",
  data() {
    return {
      selected: "推荐",
      messages: [],
    };
  },
  methods: {
    handleCommand(command) {
      this.$message("click on item " + command);
    },
    // position 为关闭时点击的位置
    // instance 为对应的 SwipeCell 实例
    beforeClose({
      position,
      instance
    }) {
      switch (position) {
        case 'left':
        case 'cell':
        case 'outside':
          instance.close();
          break;
        case 'right':
          Dialog.confirm({
            message: '确定取消关注吗？',
          }).then(() => {
            instance.close();
          });
          break;
      }
    },
  },
};
</script>

<style scoped>
.square {
  width: 375px
}

.card {
  width: 375px;
}

.box2 {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  padding: 10px;
  margin: 20px 0;
}

.box-card {
  width: 375px;
  margin-top: -20px;
  border-top: 3px solid #ffffff;
}

.nav-bar {
  position: fixed;
  width: 100%;
  background: #f7f8fa;
  z-index: 10;
}

.button2 {
  width: 375px;
  border: 0;
  background: #f7f8fa;
  margin-left: -20px;
}

.icon-img .iconfont {
  font-size: 1.2rem;
  color: #303133;
}

.box {
  width: 100%;
  margin: auto;
  position: fixed;
  bottom: 0px;
  display: flex;
}

.icon-box {
  flex: 1;
  text-align: center;
  background: rgb(236, 245, 244);
}

.icon-desc {
  color: black;
  margin-top: -10px;
}

.router-link-hover {
  background: rgb(188, 188, 235);
}

li .icon-desc {
  display: block;
  font-size: 13px;
  text-align: center;
  padding: 10px 15px;
  overflow: hidden;
}

li :hover .icon-desc {
  transform: rotate(5deg) scale(1.2);
  margin-left: 20px;
  color: #409eff;
}

li :hover .iconfont {
  color: #409eff;
  transform: rotate(5deg) scale(1.2);
}

li .icon-desc:before,
li .icon-desc:after {
  opacity: 0;
  border: 1px solid #409eff;
  content: "";
  display: block;
  position: relative;
  z-index: -1;
  margin: auto;
  width: 0px;
}

li .icon-desc:before {
  top: 23px;
  left: -25px;
  transform: rotate(115deg) translateY(-50%) translateX(-50%);
}

li .icon-desc:after {
  top: -20px;
  left: 25px;
  transform: rotate(-65deg) translateY(-50%) translateX(-50%);
}

li :hover .icon-desc:before,
li :hover .icon-desc:after {
  transition: all 0.5s ease;
  opacity: 1;
  width: 20px;
}

.mint-navbar {
  width: 50%;
  margin: auto;
  background: Transparent;
}

.mint-tab-item {
  padding: -30px;
}

.mint-navbar .mint-tab-item.is-selected {
  transform: scale(1.2);
  border: 0px;
  font-weight: bold;
}

.mint-navbar .mint-tab-item.is-selected .line {
  border-bottom: 3px solid #409eff;
}

.mint-tab-container {
  margin-top: -0px;
  border-top: 2px solid #ffffff;
}

.line {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 23px;
}

.el-card {
  background: Transparent;
}

.header {
  margin-bottom: -20px;
}

.picture {
  display: inline-block;
}

.xinxi {
  display: inline-block;
  margin-left: 1rem;
  font-size: 12px;
  font-weight: lighter;
}

.name {
  margin-bottom: 5px;
}

.more {
  float: right;
  margin-right: 10px;
}

.el-dropdown-link {
  cursor: pointer;
}

.el-icon-arrow-down {
  font-size: 16px;
  margin-top: 10px;
}

.neirong {
  margin-top: -10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-bottom {
  border: 0px;
  background: #ffffff;
  height: 40px;
  width: 44.9%;
}

.el-button--info.is-plain {
  background: #ffffff;
}

.page-part {
  width: 35%;
}

.touxiang {
  float: left;
  margin: 5px 0px 0px 5px;
}

.top-icon {
  float: right;
  margin: 7px 15px 0px 0px;
  font-size: 24px;
  color: rgb(204, 190, 0);
  font-weight: bold;
}

.button {
  position: fixed;
  right: 20px;
  bottom: 70px;
  font-size: 24px;
  z-index: 9999;
  background: rgb(4, 216, 181);
  color: #ffffff;
}

.follow-card {
  width: 327px;
  box-shadow: 0px 3px 14px rgba(78, 112, 184, 0.07);
  border-radius: 8px;
  margin: 0 auto;
}

.follow-item {
  width: 335px;
  height: 56px;
  background: #FFFFFF;
  box-shadow: 0px 3px 14px rgba(78, 112, 184, 0.07);
  border-radius: 8px;
  margin: 20px 0
}

.item-content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
}

.item-info {
  flex: 1;
  font-size: 16px;
  font-weight: bold;
  line-height: 22px;
  color: #2C2E34;
  opacity: 1;
}

.delect {
  width: 80px;
  height: 65px;
  background: #EC443C;
  border-radius: 0px 8px 8px 0px;
  position: relative;
}

.delect-text {
  height: 17px;
  font-size: 12px;
  font-weight: 400;
  line-height: 17px;
  color: #FFFFFF;
  position: absolute;
  left: 22%;
  top: 35%;
}

.item-img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50px;
}
</style>
